#include "noiseTexture.hpp"

NoiseTexture::NoiseTexture( f32 s = 1.f ) : scale( s ), col0( 0 ), col1( 1 ) {
  noiseUntil.initPerlinNoise();
}

vec3f NoiseTexture::value( const vec2f &uv, const vec3f &p ) const {
  f32 t = (1.f + noiseUntil.perlinNoise(p * scale)) / 2;
  return t * col0 + (1.f- t) * col1;
}
